﻿using System.Linq;
using MS.InformationManagement.BLL.Correspondence;
using MS.InformationManagement.Presenter.Support;
using MS.InformationManagement.Support;

namespace MS.InformationManagement.Presenter.DocumentPrinter
{
    public class DocumentPrinterListPresenter : BasePresenter<IDocumentPrinterListView>
    {
        public DocumentPrinterListPresenter(IDocumentPrinterListView view) : base(view) { }

        public void FetchUserDocuments(string userName)
        {
            /*
            int totalRecords = 0;
            View.NonFiledDocuments = DocumentPrinterBLL.GetLibraryDocuments(userName.GetUserWithOutDomain(), View.NonFiledPageIndex, View.NonFiledPageSize, out totalRecords).ToList();
            View.NonFiledTotalRecords = totalRecords;
            */
        }

        public void FetchPrintedDocuments(string userName)
        {
            /*
            View.PreviouslyPrinted = DocumentPrinterBLL.GetPrintedDocuments(userName.GetUserWithOutDomain(), View.PrevioulsyPageIndex, View.PrevioulsyPageSize).ToList();
            View.PrevioslyTotalRecords = DocumentPrinterBLL.GetPrintedDocumentsCount(userName.GetUserWithOutDomain(), View.PrevioulsyPageIndex, View.PrevioulsyPageSize);
            */
        }

        public void FetchRecordDocuments(string userName)
        {/*
            int totalRecords = 0;
            View.FiledDocuments = DocumentPrinterBLL.GetRecordDocuments(userName.GetUserWithOutDomain(), View.FiledPageIndex, View.FiledPageSize, out totalRecords).ToList();
            View.FiledTotalRecords = totalRecords;
          */
        }

        public void HandleLoad(string userName)
        {
            /*
            int nonfiledTotalRecords = 0;
            View.NonFiledPageIndex = 0;
            View.NonFiledDocuments = DocumentPrinterBLL.GetLibraryDocuments(userName.GetUserWithOutDomain(), View.NonFiledPageIndex, View.NonFiledPageSize, out nonfiledTotalRecords).ToList();
            View.NonFiledTotalRecords = nonfiledTotalRecords;
            
            View.PrevioulsyPageIndex = 0;
            View.PreviouslyPrinted = DocumentPrinterBLL.GetPrintedDocuments(userName.GetUserWithOutDomain(), View.PrevioulsyPageIndex, View.PrevioulsyPageSize).ToList();
            View.PrevioslyTotalRecords = DocumentPrinterBLL.GetPrintedDocumentsCount(userName.GetUserWithOutDomain(), View.PrevioulsyPageIndex, View.PrevioulsyPageSize);

            int recordTotalRecords = 0;
            View.FiledDocuments = DocumentPrinterBLL.GetRecordDocuments(userName.GetUserWithOutDomain(), View.FiledPageIndex, View.FiledPageSize, out recordTotalRecords).ToList();
            View.FiledTotalRecords = recordTotalRecords;
            */
        }

        public void MarkUserDocumentAsPrinted(string userName)
        {
            //View.SelectedDocumentPath = DocumentPrinterBLL.SetDocumentPrintDate(userName.GetUserWithOutDomain(), View.SelectedDocumentID, View.SelectedDocumentType);
        }

        public void MarkRecordDocumentAsPrinted(string userName)
        {
            //View.SelectedDocumentPath = DocumentPrinterBLL.SetRecordDocumentPrintDate(userName.GetUserWithOutDomain(), View.SelectedDocumentID, View.SelectedDocumentType);
        }
    }
}
